//
//  PowerHistoryVC.swift
//  LeGou
//
//  Created by 刘亿前 on 2022/9/14.
//

import UIKit
import LTScrollView

class PowerHistoryVC: ZMViewController {

    private lazy var layout: LTLayout = {
        let layout = LTLayout()
        layout.titleViewBgColor = UIColor.white
        layout.titleSelectColor = "#2D7FDF".zm.hex()
        layout.bottomLineColor = "#2D7FDF".zm.hex()
        layout.isAverage = true
        layout.sliderWidth = 17
        layout.titleColor = "#999999".zm.hex()
        layout.isNeedScale = false
        layout.isHiddenPageBottomLine = true
        layout.titleFont = UIFont.zm.fontRegular(size: 16)
        layout.showsHorizontalScrollIndicator = false
        return layout
    }()
        
    private lazy var controllers: [PowerHistoryListVC] = {
        var arr = [PowerHistoryListVC]()
        titles.forEach { val in
            let vc = PowerHistoryListVC()
            vc.state = val["state"]!
            arr.append(vc)
        }
        return arr
    }()
    
    private lazy var advancedManager: LTAdvancedManager = {
        let manager = LTAdvancedManager(frame: SCREEN_BOUNDS, viewControllers: controllers, titles: titles.map{return $0["name"]!}, currentViewController: self, layout: layout, headerViewHandle: {
            return UIView()
        })
        manager.backgroundColor = "#F5F5F5".zm.hex()
        return manager
    }()
    
    private let titles = [["state":"","name":"全部"],["state":"0","name":"缴费中"],["state":"1","name":"缴费成功"],["state":"3","name":"已退款"]]
    
    override func viewDidLoad() {
        super.viewDidLoad()
        title = "缴费记录"
        view.addSubview(advancedManager)
    }
    

}
